home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0089_Selectable Form without the main form.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  710 b   |  25 lines

  1.  
  2. {
  3. Q:  How do I make it so that only the form I select comes to 
  4. the top?  (i.e. without the main form)
  5.  
  6. A:   Try this in any secondary window that you DON'T want 
  7. dragging the program along:
  8.  
  9.   ...
  10.   private {This goes in the for's type declaration.}
  11.     { Private declarations }
  12.     procedure CreateParams(VAR Params: TCreateParams); override;
  13.   ...
  14.  
  15. procedure TForm2.CreateParams(VAR Params: TCreateParams);
  16. begin
  17.   Inherited CreateParams(Params);
  18.   Params.WndParent := GetDesktopWindow;
  19. end;
  20.  
  21.        By setting the form's parent window handle to the 
  22. desktop, you remove the link that would normally force the 
  23. whole application to come to the top when this form comes to
  24. the top.
  25.